{% load bootstrap_toolkit %}

{% if form.non_field_errors %}
    {% include "bootstrap_toolkit/non_field_errors.html" %}
{% endif %}

{% for field in form.hidden_fields %}
    {% for error in field.errors %}
        {% include "bootstrap_toolkit/non_field_error.html" %}
    {% endfor %}
{% endfor %}

{% for field in form %}
    {% if not field.name|lower in exclude|lower|split:',' %}
        {% if not fields or field.name|lower in fields|lower|split:',' %}
            {% include "bootstrap_toolkit/field.html" %}
        {% endif %}
    {% endif %}
{% endfor %}
